import Vue from 'vue'
import VueRouter from 'vue-router'
import { resolve } from 'path'
Vue.use(VueRouter)

import routerModel from '../pages/index.vue'

export default new VueRouter({
  linkActiveClass: 'link-active',
  routes: [
    { path: '/', redirect: '/index/index/index' },
    { path: '/index', redirect: '/index/index/index' },
    { path: '/index/index', redirect: '/index/index/index' },
    {
      path: '/index/index/index',
      component: resolve => require(['../pages/index/index.vue'], resolve),
      meta: { index: 0 },
      name: 'index'
    },
    { path: '/index/example', redirect: '/index/example/index' },
    {
      path: '/index/example/index',
      component: resolve => require(['../pages/example/index.vue'], resolve),
      name: 'example',
      meta: { index: 2 }
    },
    {
      path: '/index/example/detail/:info',
      component: resolve => require(['../pages/example/detail.vue'], resolve),
      name: 'example'
    },
    { path: '/index/about', redirect: '/index/about/index' },
    {
      path: '/index/about/index',
      component: resolve => require(['../pages/about/index.vue'], resolve),
      name: 'about',
      meta: { index: 4 }
    },
    {
      path: '/index/Components/contact',
      component: resolve =>
        require(['../pages/Components/contact.vue'], resolve),
      name: '联系栏'
    },
    { path: '/index/news', redirect: '/index/news/index' },
    {
      path: '/index/news/index',
      component: resolve => require(['../pages/news/index.vue'], resolve),
      name: 'news',
      meta: { index: 3 }
    },
    {
      path: '/index/news/detail/:id',
      component: resolve => require(['../pages/news/detail.vue'], resolve),
      name: 'news'
    },
    { path: '/index/VR', redirect: '/index/VR/index' },
    // {
    //   path: '/index/VR/index',
    //   component: resolve => require(['../pages/VR/index.vue'], resolve),
    //   name: 'VR'
    // },
    // { path: '/index/WX', redirect: '/index/WX/index' },
    // {
    //   path: '/index/WX/index',
    //   component: resolve => require(['../pages/WX/index.vue'], resolve),
    //   name: '微信定制'
    // },
    // {
    //   path: '/index/App/index',
    //   component: resolve => require(['../pages/App/index.vue'], resolve),
    //   name: 'App定制开发'
    // },
    // {
    //   path: '/index/Website/index',
    //   component: resolve => require(['../pages/Website/index.vue'], resolve),
    //   name: '网页建设'
    // },
    // {
    //   path: '/index/fuwu/index',
    //   component: resolve => require(['../pages/fuWu/fuwu.vue'], resolve),
    //   name: '服务'
    // },

    {
      path: '/index/fuwu/index',
      component: resolve => require(['../pages/fuWu/index.vue'], resolve),
      name: '服务'
    },
    { path: '/index/fuwu/index', redirect: '/index/fuwu/website' },
    {
      path: '/index/fuwu/website',
      component: resolve => require(['../pages/Website/index.vue'], resolve),
      name: 'web'
    },
    {
      path: '/index/fuwu/vr',
      component: resolve => require(['../pages/VR/index.vue'], resolve),
      name: 'vr'
    },
    {
      path: '/index/fuwu/wechat',
      component: resolve => require(['../pages/WX/index.vue'], resolve),
      name: 'wechat'
    },
    {
      path: '/index/fuwu/qq',
      component: resolve => require(['../pages/WX/qq.vue'], resolve),
      name: '定制'
    },
    {
      path: '/index/fuwu/app',
      component: resolve => require(['../pages/App/index.vue'], resolve),
      name: 'app'
    },
    {
      path: '/index/service/index',
      component: resolve => require(['../pages/service/index.vue'], resolve),
      name: 'wechat1'
    },
    {
      path: '/index/fuwu/website',
      component: resolve => require(['../pages/Website/index.vue'], resolve),
      name: 'web'
    },
    {
      path: '/index/Components/header',
      component: resolve =>
        require(['../pages/Components/header.vue'], resolve),
      name: '头部'
    },
    {
      path: '/index/Components/Banner',
      component: resolve =>
        require(['../pages/Components/Banner.vue'], resolve),
      name: '海报'
    },
    {
      path: '/index/Components/weCan',
      component: resolve => require(['../pages/Components/weCan.vue'], resolve),
      name: '分类导航'
    },
    {
      path: '/index/Components/footer',
      component: resolve =>
        require(['../pages/Components/footer.vue'], resolve),
      name: '页脚'
    }
  ],
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 }
  },
  mode: 'history'
})
